<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
</head>
<body>
	<script>
		/**
		 * keydown：按键按下
		 * keyup：按键抬起
		 * keypress：按键按下抬起
		 **/
		document.onkeydown = function(event){
			let e = event || window.event || arguments.callee.caller.arguments[0];
			e.preventDefault();
			console.log(e.keyCode);
		}
	</script>
</body>
</html>